
import * as CONSTANT from '../constant';

const defaultState = {user:{},error:''} 


const reducer  = (state=defaultState,action)=>{
    switch (action.type) {
        case CONSTANT.USER:
           let user  =action.payload
           console.log(user);
           return {...state,user}
        case CONSTANT.USER_ERROR:
           let error  =action.payload
           console.log('reducer',error);
           return {...state,error}
        default:
           return state
    }
}

export default reducer